package com.atom.module.lib.opengles.util

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.lang.StringBuilder

/**
 * All rights Reserved, Designed By www.rongdasoft.com
 * @version V1.0
 * @Title: StreamUtils
 * @Description:
 * @author: wuyongzheng
 * @date: 2022/1/18
 * @Copyright: 2022/1/18 www.rongdasoft.com Inc. All rights reserved.
 */
object StreamUtils {

    fun readInputStream(inputStream: InputStream): String {
        var reader: BufferedReader? = null
        return try {
            reader = BufferedReader(InputStreamReader(inputStream))
            val sb = StringBuilder()
            var s = reader.readLine()
            while (s != null) {
                sb.append(s)
                s = reader.readLine()
            }
            sb.toString()
        } finally {
            ClosedUtils.closeSilently(reader)
        }
    }

}